home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / dataconv / readme.txt < prev   
Text File  |  1995-12-22  |  6KB  |  124 lines

  1.  
  2.  DBFtoSQL - 'Fixed up' by:  Pete Ness
  3.                             scream@primenet.com
  4.                             CID: 102347,710
  5.  
  6.  This program was not originally written by me, I got it's raw state
  7.  from Glynn Owen, Compuserve ID# 71073,2552 off the Delphi Forum.
  8.  It wasn't quite what I was looking for, but had some potential.  I've
  9.  re-done just about everything since, but the original author deserve
  10.  credit for the original work - the BatchMove component started as his
  11.  idea.
  12.  
  13.  The original author used this to import DBF's to Interbase SQL.  There
  14.  are really no utilities out there that I've found to do this well -
  15.  thus I wrote my own.  I use Microsoft SQL 6.0 and needed to import
  16.  data from Foxpro files.  This was originally written to go from
  17.  DBF's to SQL only, but it should work to move data from any ODBC
  18.  source to any other ODBC source (through the BDE).  I'm still having
  19.  some problems with SQL 6.0 blocking the inserts after the first 75 -
  20.  150 records on some tables - most tables seem to work fine, however.
  21.  If anyone has this problem with this, let me know and we'll figure
  22.  out how to fix it.  I will also upload a fixed version when I find
  23.  the problem.
  24.  
  25. **************** Glynn's Original Text (CID#71073,2552) *********************
  26.  
  27. This utility uses the TBatchMove component to copy a dBase database to an
  28. Interbase table. This is the third version of the program that I have written
  29. so far. The first used a parameterized insert that had some problems with
  30. datatypes.
  31.  
  32. The second handed off the processing to the background, and inserted records
  33. one at a time. This version did allow me to specify the correspondence between
  34. the datatypes of dBase and Interbase, but was very slow.
  35.  
  36. This final version will copy 10,000 records in less than 2 minutes on my 60Mhz
  37. Pentium system.
  38.  
  39. This utility has been really handy in helping me to learn something about how
  40. components work, as well as being a very useful tool for setting up IB tables
  41. that have some familiar content.
  42.  
  43. *************** End of Original Author's Documentation **********************
  44.  
  45. This program uses BDE alias to copy data from one database to another.
  46. Delphi's TBatchMove component does all the conversion of data types.
  47.  
  48. Compile the program using Delphi - I have Apollo and had some initial problems
  49. with this app when Apollo was installed, so if you have problems, link up
  50. a DCL without.
  51.  
  52. Before you can do any converting, you need to run the BDE config program to
  53. set up aliases to the data you want to convert to and from.  You CAN use
  54. existing aliases.  Run the program.  Select the source alias from the
  55. drop down box.  If the source database is a NON-SQL type and you didn't
  56. specify a path in the Alias setup, you can specify a path now.  Otherwise,
  57. the Alias path will be displayed but you won't be able to change it.
  58. Select a file to convert (pretty straight forward stuff so far).
  59.  
  60. Do the same thing for the destination.  Pick the alias, path and table name.
  61. Next, select what you are want to do with the table.  I've used append the
  62. most - Append uses the existing structure of your destination file and converts
  63. the data to fit it.  If you want to create a new table, pick Create.  I have not
  64. tested the other 3 options, although these setting are directly tied to the
  65. setting in the Delphi TBatchMove Component - see your Delphi documention if
  66. you have any questions.
  67.  
  68. OK, next select Convert.  The program will pull up a field list of all the
  69. fields in your source file and create a text file with lines in the form of
  70.  
  71. DESTINATION=SOURCE
  72.  
  73. Initially, these will be the same, but you can specify the field name for the
  74. destination if it's different, or delete fields altogether.  Be aware if you
  75. are creating a SQL table that many "Normal" dbf field names are now illegal -
  76. most notably for me, CURRENT can no longer be a field name.  If you pick
  77. an invalid name, the program will tell you and you can change it to something
  78. else.
  79.  
  80. Before you actually do the conversion, Save the field setup you've just edited
  81. so you can re-load it if something goes wrong.  Now, hit convert and away it
  82. goes - if everything is right.  If anything isn't quite right, you'll get an
  83. error and you can go fix it - all the setting should stay the same until you
  84. exit the program.
  85.  
  86. The progress bar can slow you down quite a bit as every time it updates, the
  87. TBatchMove component must re-initialize.  Right now, it converts in 2% chunks -
  88. I figure that's a good tradeoff to see that it's working.  If you think it
  89. slow you down too much, change the program - there's documentation at that
  90. part to show you how.
  91.  
  92. If you have any problems, feedback, or cool changes you find/need/want/do,
  93. drop me a note.  I think it would be fantastic to have a good data conversion
  94. tool for Delphi and I think this is a step in the right direction.
  95.  
  96. Pete Ness
  97. scream@primenet.com
  98. CID: 102347,710
  99.  
  100. History.....................................................................
  101.  
  102. First Version Uploaded to Compuserve on 9/15/95 12:05 am.
  103.  
  104. 9/15/95 6:00pm
  105.  
  106. Found a couple of problems (I didn't do the final testing with SQL server
  107. and I introduced a couple of problems)
  108.  
  109. Added a parameter edit memo field so the password could be set up once and
  110. not be re-entered at every access.  After specifying the Alias you want to
  111. use, hit the Property speed button (right beside the alias field) to pull
  112. up a list of parameters from the BDE.
  113.  
  114. It now changes directory before getting the file list or opening either the
  115. source or destination TTables so that ODBC drivers set up to pull files from
  116. the current directory would work better.
  117.  
  118. Set the path to empty if there is none, instead of garbage characters.
  119.  
  120. Added hints to the main form.
  121.  
  122. 9/15/95 7:30 pm  Upload fixed version to Compuserve.
  123.  
  124.